package cn.pn.project.client.order;

import cn.pn.project.config.DmConfiguration;
import cn.pn.project.client.order.fallback.SchedulerOrderClientFallBack;
import cn.pn.project.pojo.schedule.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * 排期订单Client
 */
@FeignClient(name = "pn-scheduler-provider", configuration = DmConfiguration.class/*, fallback = SchedulerOrderClientFallBack.class*/)
public interface RestSchedulerOrderClient {

    /**
     * 多条件查询座位信息对象（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getSeatByMap")
    public Seat getSeatByMap(@RequestParam Map<String,Object> param)throws Exception;

    /**
     * 多条件查询票档对象（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getTicketFileByMap")
    public Ticketfile getTicketFileByMap(@RequestParam Map<String,Object> param)throws Exception;

    /**
     * 多条件查询场地集合（谢耀翔）
     * @param param
     * @return
     * @throws SQLException
     */
    @PostMapping("/getPlaceListByMap")
    public List<Place> getPlaceListByMap(@RequestParam Map<String,Object> param) throws SQLException;

    /**
     * 多条件查询场地对象（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getPlaceByMap")
    public Place getPlaceByMap(@RequestParam Map<String,Object> param)throws Exception;

    /**
     * 多条件查询场次集合（谢耀翔）
     * @param param
     * @return
     * @throws SQLException
     */
    @PostMapping("/getCommoditysessionListByMap")
    public List<Commoditysession> getCommoditysessionListByMap(@RequestParam Map<String,Object> param) throws SQLException;

    /**
     * 多条件查询场次对象（谢耀翔）
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping("/getCommoditysessionByMap")
    public Commoditysession getCommoditysessionByMap(@RequestParam Map<String,Object> param)throws Exception;
    /**
     * 新增商品座位记录（谢耀翔）
     * @param seatcommodity
     * @return
     * @throws Exception
     */
    @PostMapping("/insertSeatcommodity")
    public Integer insertSeatcommodity(Seatcommodity seatcommodity)throws Exception;


    @PostMapping("/updateTicketRepertory")
    public Integer updateTicketRepertory(@RequestParam(value = "ticketfileid",required = false) Integer ticketfileid,@RequestParam(value = "count",required = false) Integer count);
}
